﻿using System.Threading;
using System.Threading.Tasks;
using Xms.Abp.Data.Message;

namespace Xms.Abp.Messaging.Smsing;

public abstract class TemplateSmsSenderProviderBase: ITemplateSmsSenderProvider
{
    protected SmsSettings SmsSettings { get; }
    protected SupplierSmsSettings SupplierSmsSettings { get; }
    public TemplateSmsSenderProviderBase(
        SmsSettings smsSettings,
        SupplierSmsSettings supplierSmsSettings)
    {
        SmsSettings = smsSettings;
        SupplierSmsSettings = supplierSmsSettings;
    }
    public abstract string ProviderName { get; }

    public virtual bool IsEnabled => SupplierSmsSettings?.IsEnabled ?? false;

    public abstract Task<SentResult<SmsSentResultItem>> SendSmsAsync(SmsMessage smsMessage, CancellationToken stoppingToken = default);
}
